package xxm.utility.main;

import xxm.utility.net.BasicBufferTcpHelper;
import xxm.utility.net.BasicCmdHeader;
import xxm.utility.net.BasicNString;
import xxm.utility.pack.BasicPacket;
import xxm.utility.pack.BasicTcpPacket;

public class UploadPicResponse implements BasicBufferTcpHelper{

	public BasicCmdHeader header = new BasicCmdHeader();
	public byte isSucceed;
	public byte errorCode;
	public BasicNString fileName = new BasicNString();
	public BasicNString Url = new BasicNString();
	
	
	@Override
	public int formatBasicPacket(BasicPacket pack) {
		// TODO Auto-generated method stu
		header.formatBasicPacket(pack);
		pack.put(isSucceed);
		pack.put(errorCode);
		fileName.formatBasicPacket(pack);
		Url.formatBasicPacket(pack);
		return 0;
	}

	@Override
	public int parserBasicPacket(BasicPacket pack) {
		// TODO Auto-generated method stub
		header.parserBasicPacket(pack);
		isSucceed = pack.get();
		errorCode = pack.get();
		fileName.parserBasicPacket(pack);
		Url.parserBasicPacket(pack);
		return 0;
	}

	@Override
	public int formatBasicPacket(BasicTcpPacket pack) {
		// TODO Auto-generated method stub
		return formatBasicPacket((BasicPacket) pack);
	}

	@Override
	public int parserBasicPacket(BasicTcpPacket pack) {
		// TODO Auto-generated method stub
		return parserBasicPacket((BasicPacket)pack);
	}

}
